home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Prog
/
D-G
/
GameMaster.cpt
/
GameMaster
/
GameMaster
next >
Wrap
Text File
|
1987-06-06
|
22KB
|
888 lines
' **********************************
' GameMaster v1.0
' Role Playing Character Record System
' by L. Frank Turovich
'
' Copyright 1987 by Ankh Enterprises
' Completed June 87
'
' *Requires MS-BASIC Toolbox Routines
'
' Any comments, critisisms, or suggestions
' would be appreciated at:
' GEnie address: BALTHASARD
'
' A generic character record keeping system
' for role playing games.
'
'
'---------------------------------------
WINDOW CLOSE 1
CLEAR 22000
LIBRARY "ToolLib"
GOSUB Initialization
ON MENU GOSUB MenuEvent : MENU ON
ON DIALOG GOSUB DialogEvent : DIALOG ON
MainLoop:
INITCURSOR
GOTO MainLoop
' ---------------------------------------
' SECTION A : Menu events subsection
' ---------------------------------------
MenuEvent:
ChangeCursor! 4
menuID=MENU(0) : itemID=MENU(1)
ON menuID GOSUB FileMenu, ,CreateMenu,RecMenu
EndMenuEvt:
MENU menuID,0,1
INITCURSOR
RETURN
FileMenu:
ON itemID GOSUB OpenRecord,CloseFile,SaveChar, ,MoveChar,DelChar,PrintOne, ,QuitBas,QuitDesk
RETURN
OpenRecord:
ON ERROR GOTO FileError
GOSUB GetCharRecord
ON ERROR GOTO 0
IF FileTitle$="" THEN RETURN
IF numRecords=0 THEN GOSUB OpenErr : GOSUB FiniFile : RETURN
GOSUB DrawRecMenu
MENU 1,2,1,"Close : "+FileTitle$+" "
MENU 3,1,0 : MENU 1,1,0
RETURN
CloseFile:
GOSUB CompareFile
IF changed=false THEN FiniClose
GOSUB SaveErr
IF btnID=2 THEN RETURN
IF btnID=3 THEN GOSUB SaveChar
FiniClose:
WINDOW CLOSE 1
scrnFlag=false : FileTitle$=""
GOSUB ReDoRec
MENU 1,2,0,"Close "
MENU 1,3,0 : MENU 1,5,0
MENU 1,6,0 : MENU 1,7,0
MENU 3,1,1 : MENU 1,1,1
CLOSE#2
RETURN
MoveChar:
' Open a second record file to move currently displayed
' character file to
DIM CharMove$(numEF)
SecTitle$=FILES$(1,"char")
ChangeCursor! 4
IF SecTitle$="" THEN ERASE CharMove$ : RETURN
ON ERROR GOTO FileError
OPEN "R",#3,SecTitle$,1135
idiot=0 : fred=0 : WordDt$="" : D9$=""
FOR j=1 TO numEF
IF j<lora-1 THEN fred=fldLen(j) ELSE fred=fldLen(24)
FIELD#3, idiot AS D9$,fred AS CharMove$(j)
idiot=idiot+fred
NEXT j
numRecords=LOF(3)/1135
' look for first empty record in open file, save character
' to that file
GOSUB GetEmptyFile
IF found=false THEN GOSUB FullCharFile
GOSUB MoveTheChar
FOR j=numEF TO 1 STEP-1
LSET CharMove$(j)=CharData$(j)
NEXT j
PUT#3 ,empty
EndMove:
CLOSE #3
ERASE CharMove$
WINDOW CLOSE 4
RETURN
DelChar:
IF PEEK(379)=4 THEN GOTO DelChar2
GOSUB DeleteWarning
IF btnID=2 THEN RETURN
DelChar2:
GOSUB BlankFile ' Wipe out the character file in buffer
PUT #2,file(0) ' Write to disk
GOSUB DrawRecMenu ' redraw record menu
GOSUB DoRecAgain
RETURN
BlankFile:
LSET CharData$(1)="<< name >>"
FOR j=2 TO numEF
LSET CharData$(j)=" "
NEXT
RETURN
PrintOne:
GOSUB DoReport
GOSUB EndPrint
charFlag=false
RETURN
QuitBas:
GOSUB CloseFile
MENU RESET
WINDOW CLOSE WINDOW(1)
LIST
END
QuitDesk:
GOSUB CloseFile
MENU RESET
SYSTEM
CreateMenu:
ON itemID GOSUB CreateFile,ReportStyle, ,ProgInfo,Help
RETURN
CreateFile:
FileTitle$=FILES$(0,"Call this character file:")
ChangeCursor! 4
IF FileTitle$="" THEN RETURN
CALL StrpName (FileTitle$)
ON BREAK GOSUB RecordQuit : BREAK ON
GOSUB CreateFMsg
FOR numfile=1 TO 16
MOVETO 30,80 : DrawText! "Creating record #";numfile;
GOSUB NewCharFile
GOSUB BlankFile
ON ERROR GOTO FileError
PUT #2,numfile
CLOSE#2
NEXT numfile
NAME FileTitle$ AS FileTitle$,"char"
WINDOW CLOSE 4
scrnFlag=false : file(0)=1
GOSUB NewCharFile
GOSUB DrawRecMenu
MENU 1,2,1,"Close "+FileTitle$+" "
MENU 3,1,0 : MENU 1,1,0
GOSUB DoRecAgain
RETURN
RecordQuit:
BREAK OFF
CLOSE #2
KILL FileTitle$ : BEEP
WINDOW CLOSE 4
ON ERROR GOTO 0
RETURN EndMenuEvt
FileError:
IF ERR=52 THEN RESUME RecordQuit
IF ERR=55 THEN GOSUB MoveErr : RESUME MoveChar
IF ERR<>53 THEN ON ERROR GOTO 0
RESUME NEXT
ProgInfo:
CALL TitleScreen
RETURN
Help:
CALL Instruct
RETURN
RecMenu:
IF FileTitle$="" THEN RETURN
IF scrnFlag=true THEN GOSUB SaveChar
ChangeCursor! 4
file(0)=MENU(1)
DoRecAgain:
GET #2,file(0)
MENU 4,file(0),2
MENU menuID,0,1
IF scrnFlag=false THEN GOSUB CharDisplay ELSE GOSUB NewScrn
RETURN
DrawRecMenu:
MENU 4,0,1,FileTitle$
FOR h=1 TO numRecords
GET#2,h
a$=FN Drop$(CharData$(1))
b$=CharData$(2)
c$=FN Drop$(CharData$(3))
d$=a$+" : Lvl "+b$+c$
MENU 4,h,1,d$
NEXT h
RETURN
' ---------------------------------
' SECTION B : Character Editing
' ---------------------------------
CharDisplay:
scrnFlag=true : top=30 : left=10
WINDOW 1,"",(left,top)-(500,330),2
MENU 1,3,1 : MENU 1,5,1
MENU 1,6,1 : MENU 1,7,1
PICTURE ON
SHOWPEN
TEXTFONT(4) : TEXTSIZE(9) : TEXTMODE(1)
MOVETO 10,10 : DrawText! "Edit character data"
FOR h=1 TO lora
rSide=lSide(h)-LEN(Title$(h))*8
MOVETO rSide,y(h)-1 : DrawText! Title$(h)
NEXT h
MOVETO 0,13 : LINETO 550,13
MOVETO 0,115 : LINETO 550,115
MOVETO 0,117 : LINETO 550,117
MOVETO 180,117 : LINETO 180,345
MOVETO 182,117: LINETO 182,345
PSET(181,117),30
PICTURE OFF
GenPic$=PICTURE$
NewScrn:
FOR h=1 TO lora-2
IF h<9 THEN type=1 ELSE type=2
IF h=2 THEN type=2
rSide=lSide(h)+(fldLen(h)*6)+4
EDIT FIELD h,CharData$(h),(lSide(h),y(h)-10)-(rSide,y(h)), ,type
NEXT h
y=130
FOR h=lora-1 TO lora+10
EDIT FIELD h,CharData$(h),(5,y+4)-(170,y+14)
EDIT FIELD h+12,CharData$(h+12),(192,y+4)-(335,y+14)
EDIT FIELD h+24,CharData$(h+24),(345,y+4)-(485,y+14)
y=y+14
NEXT h
numFields=numEF : eField=1
EDIT FIELD eField
INITCURSOR
RETURN
CompareFile:
IF scrnFlag=false THEN RETURN
changed=false
FOR j=1 TO numEF
IF EDIT$(j)<>CharData$(j) THEN changed=true
IF changed=true THEN RETURN
NEXT j
RETURN
CheckRet:
IF d<>6 THEN RETURN
CALL ChangeCursor! 4
GOSUB SaveChar
GOSUB DoRecAgain
RETURN
' ---------------------------------------
' SECTION C : Dialog Events
' ---------------------------------------
DialogEvent:
d=DIALOG(0)
ON d GOSUB DoBttns,DoEdit, , ,DoRefresh,DoReturn,DoTab
RETURN
DoBttns:
btnID=DIALOG(1)
RETURN
DoEdit:
eField=DIALOG(2)
EDIT FIELD eField
RETURN
DoRefresh:
IF WINDOW(0)<>1 THEN RETURN
PICTURE ,GenPic$
RETURN
DoReturn:
done=true
RETURN
DoTab:
GOSUB CheckLen
IF tooLong=1 THEN tooLong=0 : GOSUB DoRefresh : GOTO FiniTab
IF PEEK(379)=1 THEN GOTO ShiftTab
IF PEEK(379)=4 THEN GOTO OptTab
eField=(eField MOD numFields)+1
GOTO FiniTab
ShiftTab:
IF eField=>1 THEN eField=eField-1
IF eField=0 THEN eField=numFields
GOTO FiniTab
OptTab:
IF eField<=8 THEN eField=9 : GOTO FiniTab
IF eField<lora-2 AND eField>8 THEN eField=lora-1 : GOTO FiniTab
IF eField>lora-2 AND eField<lora+11 THEN eField=lora+11 : GOTO FiniTab
IF eField=>lora+11 THEN eField=1
FiniTab:
EDIT FIELD eField
RETURN
CheckLen:
IF eField=>35 THEN l=LEN(EDIT$(eField)) : IF l>fldLen(24) THEN GOSUB LenError : RETURN
IF eField=>23 THEN l=LEN(EDIT$(eField)) : IF l>fldLen(23) THEN GOSUB LenError : RETURN
IF eField<23 THEN l=LEN(EDIT$(eField)) : IF l>fldLen(eField) THEN GOSUB LenError
RETURN
' --------------------------------------
' SECTION D : I/O File Routines
' --------------------------------------
SaveChar:
IF FileTitle$="" THEN RETURN
ChangeCursor! 4
FOR j=numEF TO 1 STEP-1
LSET CharData$(j)=EDIT$(j)
NEXT j
PUT#2,file(0)
GOSUB DrawRecMenu
RETURN
GetEmptyFile:
FOR empty=1 TO numRecords
GET #3,empty
IF LEFT$(CharMove$(1),2)="<<" THEN found=true ELSE found=false
IF found=true THEN RETURN
NEXT empty
RETURN
GetCharRecord:
FileTitle$=FILES$(1,"char")
ChangeCursor! 4 : IF FileTitle$="" THEN RETURN
NewCharFile:
OPEN "R",#2,FileTitle$,1135
null=0 : fred=0 : WordDt$="" : D9$=""
FOR j=1 TO numEF
IF j<lora-1 THEN fred=fldLen(j) ELSE fred=fldLen(24)
FIELD#2, null AS D9$,fred AS CharData$(j)
null=null+fred
NEXT j
numRecords=LOF(2)/1135
CALL StrpName (FileTitle$)
RETURN
' ---------------------------------------
' SECTION E : Printer Events
' ---------------------------------------
ReportStyle:
GOSUB CheckOpenFile
GenPic$="" : report=2
IF scrnFlag=true THEN GOSUB SaveChar : WINDOW CLOSE 1
IF scrnFlag=true THEN scrnFlag=false
WINDOW 3,"",(40,35)-(470,320),-2
TEXTFONT(0) : y=30
MOVETO 20,15 : PRINT"GameMaster Report Sheets"
MOVETO 0,20 : LINETO 500,20
bmsg$(3)="GM's Info"
bmsg$(4)="Character Info"
BUTTON 3,1,bmsg$(3),(140,y)-(250,y+15),3
BUTTON 4,2,bmsg$(4),(140,y+18)-(270,y+33),3
y=95
FOR j=1 TO numRecords
IF j<9 THEN x=20 ELSE x=225
IF j=9 THEN y=95
GET #2,j
BUTTON j+4,1,CharData$(1),(x,y)-(x+180,y+15),2
IF LEFT$(CharData$(1),2)="<<" THEN BUTTON j+4,0
y=y+18
NEXT j
LINE (10,81)-(420,245), ,b
LINE (8,79)-(422,247), ,b
MOVETO 20,85 : PRINT" Character selection... "
CALL ShowBttns ("Print","",1,0)
INITCURSOR
DIALOG OFF
done=false
WHILE NOT done
WHILE DIALOG(0)<>1 : WEND
btnID=DIALOG(1)
IF btnID<3 THEN done=true
IF (btnID=3) OR (btnID=4) THEN GOSUB SetBtn : report=btnID-2
IF btnID>4 THEN GOSUB CharTabSet
WEND
DIALOG ON
WINDOW CLOSE 3
IF btnID=1 THEN GOSUB DoReport
CancReport:
RETURN
CheckOpenFile:
IF FileTitle$="" THEN GOSUB OpenRecord
IF FileTitle$="" THEN RETURN MainLoop
RETURN
CharTabSet:
IF file(btnID-4)=0 THEN BUTTON btnID,2 ELSE BUTTON btnID,1
IF file(btnID-4)=0 THEN file(btnID-4)=true ELSE file(btnID-4)=0
RETURN
SetBtn:
FOR j=3 TO 4
BUTTON j,1
NEXT j
BUTTON btnID,2
RETURN
DoReport:
Esc$=CHR$(27)
FF$=CHR$(12)
IF PEEK(379)=4 THEN GOTO PrtChar2
GOSUB PrintWarning
IF btnID=2 THEN RETURN
PrtChar2:
ChangeCursor! 4
ON BREAK GOSUB PrintQuit : BREAK ON
GOSUB ReportWarning
Dt$=DATE$
LPRINT Esc$;"c";
LPRINT Esc$;"L008";
LPRINT Esc$;"E";
IF charFlag=true THEN GOTO PrintCharSheet
ReportLoop:
k=0 : numFiles=0: '______ set up tab for later print view
FOR x=1 TO numRecords
IF file(x)=0 THEN GOTO NextRec
GET #2,x
ON report GOSUB PrintDMSheet,PrintCharSheet
NextRec:
NEXT x
GOTO EndPrint
PrintQuit:
BREAK OFF
LPRINT CHR$(24)
EndPrint:
IF report=1 AND numFiles<8 THEN LPRINT FF$;
FOR x=1 TO numRecords
file(x)=0
NEXT
WINDOW CLOSE 4
GOSUB CancReport
IF charFlag=true THEN RETURN ELSE RETURN EndMenuEvt
PrintDMSheet:
numFiles=numFiles+1
LPRINT CHR$(14);
IF numFiles=1 THEN LPRINT TAB(12) "GameMasters Info Sheet for "+Dt$
LPRINT CHR$(15);
LPRINT TAB(k);STRING$(80,"=")
LPRINT " "
LPRINT FN Drop$(CharData$(1));TAB(22) "HP: "+CharData$(17);TAB(40) "STR: "+CharData$(9);TAB(52) "INT: "+CharData$(12);TAB(65) CharData$(24)
LPRINT CharData$(2)+FN Drop$(CharData$(3));TAB(22) "AC: "+CharData$(16);TAB(40) "DEX: "+CharData$(10);TAB(52) "WIS: "+CharData$(13);TAB(65) CharData$(25)
LPRINT FN Drop$(CharData$(4));TAB(22) FN Drop$(CharData$(7));TAB(40) "CON: "+CharData$(11);TAB(52) "CHR: "+CharData$(14);TAB(65) CharData$(26)
LPRINT "("+FN Drop$(CharData$(58))+")";TAB(22) FN Drop$(CharData$(8));TAB(52) "COM: "+CharData$(15);TAB(65) CharData$(27)
LPRINT " "
IF numFiles=8 THEN LPRINT FF$ : numFiles=0
RETURN
PrintCharSheet:
LPRINT CHR$(14);
LPRINT "Player's Info Sheet for "+Dt$
LPRINT CHR$(15);
LPRINT " "
LPRINT TAB(k);FN Drop$(CharData$(1));TAB(k+60);"HP: "+CharData$(17)
LPRINT TAB(k);CharData$(2)+FN Drop$(CharData$(3));TAB(k+30);"Exp Pts: "+FN Drop$(CharData$(18));TAB(k+60);"AC: "+CharData$(16)
LPRINT TAB(k);FN Drop$(CharData$(4))TAB(k+30);"Gold: "+CharData$(20);
LPRINT TAB(k);FN Drop$(CharData$(5));TAB(k+30);"Silver: "+CharData$(21);TAB(k+60);FN Drop$(CharData$(7))
LPRINT TAB(k);CharData$(6);TAB(k+30);"Plat: "+FN Drop$(CharData$(22));TAB(k+60);FN Drop$(CharData$(8))
LPRINT TAB(k);"("+FN Drop$(CharData$(58))+")";TAB(k+30);"Gems: "+FN Drop$(CharData$(19))
LPRINT TAB(k);STRING$(80,"=")
LPRINT TAB(k);"STR: "+CharData$(9);" "+first$;TAB(k+60);"Saving Throws:"
LPRINT TAB(k);"DEX: "+CharData$(10);" "+sec$;TAB(k+60);"-------------"
LPRINT TAB(k);"CON: "+CharData$(11);" "+other$;TAB(k+60);"Poison:"
LPRINT TAB(k);"INT: "+CharData$(12);" "+fourth$;TAB(k+60);"Petri:"
LPRINT TAB(k);"WIS: "+CharData$(13);" "+fifth$;TAB(k+60);"Rods:"
LPRINT TAB(k);"CHR: "+CharData$(14);" "+sixth$;TAB(k+60);"Breath:"
LPRINT TAB(k);"COM: "+CharData$(15);TAB(k+60);"Spells:";s(5)
LPRINT TAB(k);STRING$(80,"-")
NextLine:
LPRINT TAB(k);"Special Abilities:"
LPRINT TAB(k);"Languages:"
LPRINT TAB(k);STRING$(80,"-")
LPRINT TAB(k);"Misc Items:";TAB(k+30);"Magic Items:";TAB(k+60);"Attack Table:"
LPRINT TAB(k);"-----------";TAB(k+30);"-----------";TAB(k+60);"-------------"
i$=CHR$(124)
FOR j=35 TO 57
IF j<47 THEN LPRINT TAB(k);CharData$(j);TAB(k+30);CharData$(j-12);TAB(k+60);j-38;TAB(k+65);i$+" "+i$+" "+i$+" "+i$+" "i$
IF j>46 THEN LPRINT TAB(k);CharData$(j)
NEXT j
LPRINT FF$
RETURN
' ---------------------------------------
' SECTION F : Subroutines
' ---------------------------------------
SUB StrpName (FileTitle$) STATIC
SHARED Path$,FileTitle$
position=LEN(FileTitle$)
WHILE INSTR(position,FileTitle$,":")=0
position=position-1
WEND
Path$=LEFT$(FileTitle$,position)
FileTitle$=MID$(FileTitle$,position+1)
END SUB
SUB WindSize STATIC
SHARED r,b
r=WINDOW(2) : b=WINDOW(3)
END SUB
SUB ShowBttns (OK$,Extra$,cancl,other) STATIC
SHARED r,b
CALL WindSize
BUTTON 1,1,OK$,(r-90,b-28)-(r-10,b-10),1
IF cancl=0 THEN GOTO FiniSub
BUTTON 2,1,"Cancel",(r-180,b-28)-(r-100,b-10),1
IF other=0 THEN GOTO FiniSub
BUTTON 3,1,"Save",(r-270,b-28)-(r-190,b-10),1
FiniSub:
END SUB
SUB PaintBttn (r,b) STATIC
rf%(0)=b-32 : rf%(1)=r-94
rf%(2)=b-6 : rf%(3)=r-6
PENSIZE 3,3
FRAMEROUNDRECT VARPTR(rf%(0)),15,15
END SUB
SUB Message (msg$(),state,cancl,other) STATIC
SHARED btnID,r,b
WINDOW 4,,(90,70)-(420,170),2
TEXTFONT(0) : M$=msg$(1)+msg$(2)
IF state=1 THEN BEEP
SetRect! mb%(0),20,20,300,65
TextBox! M$,mb%(0),0
IF state=0 THEN EXIT SUB
CALL WindSize
CALL PaintBttn (r,b)
ShowBttns "Yes","",cancl,other
INITCURSOR
DIALOG OFF
d=0
WHILE d<>1 AND d<>6
d=DIALOG(0)
WEND
btnID=DIALOG(1)
IF d=6 THEN btnID=1
DIALOG ON
WINDOW CLOSE 4
END SUB
SUB Instruct STATIC
WINDOW 3,,(10,30)-(500,330),-2
TEXTFONT(4) : TEXTSIZE(9)
DIM Info$(5)
Info$(1)="Index" : Info$(2)="File" : Info$(3)="Create"
Info$(4)="Cancel"
btnID=1 : GOSUB PageOne
y=290 : x=60
FOR j=1 TO 4
BUTTON j,1,Info$(j),(x,y-18)-(x+90,y)
x=x+95
NEXT j
INITCURSOR
BUTTON 1,0
WLoop:
WHILE DIALOG(0)<>1 : WEND
btnID=DIALOG(1)
ON btnID GOSUB PageOne,PageTwo,PageThree,CloseSub
FOR x=1 TO 4
BUTTON x,1
NEXT x
BUTTON btnID,0
GOTO WLoop
PageOne:
n=8 : GOSUB HeaderDis
PRINT TAB(n+3)"GameMaster is a complete character management system designed "
PRINT TAB(n)"to facilitate the record keeping chores of the game referee"
PRINT TAB(n)"in a role playing environment."
PRINT TAB(n+3)"With GameMaster the game referee can keep track of all player"
PRINT TAB(n) "characters, NPC's, and other miscellaneous persona needed"
PRINT TAB(n)"for good role playing adventures."
PRINT TAB(n+3)"GameMaster was written by a game master for his own campaign "
PRINT TAB(n) "use and has reduced many of the tedious routines once done with "
PRINT TAB(n)"index cards."
PRINT TAB(n+3)"On the character edit screen GameMaster uses several keyboard "
PRINT TAB(n)"shortcuts to make data entry easy..."
PRINT
PRINT TAB(n+3)"<Tab> moves you to the next edit field."
PRINT TAB(n+3)"<Shift><Tab> moves you back up one edit field."
PRINT TAB(n+3)"<Option><Tab> moves you to the next block of edit fields."
PRINT TAB(n+3)"<Command><Return> saves character information to disk."
PRINT TAB(n+3)"Using the <Option> key when selecting a menu item will bypass"
PRINT TAB(n+6)"many of the warning windows."
PRINT
PRINT TAB(n+3)"Simply click on one of the menu buttons displayed below to get"
PRINT TAB(n) "further details about GameMaster."
RETURN
PageTwo:
n=22 : GOSUB HeaderDis
PRINT" Open ";TAB(n)"Opens a character file as the Record menu for"
PRINT TAB(n);"easy record selection."
PRINT
PRINT" Close";TAB(n)"Closes the open character file."
PRINT
PRINT" Save";TAB(n)"Saves character record open to character file open."
PRINT
PRINT" Move";TAB(n)"Duplicates a character record from the open character"
PRINT TAB(n)"file to another character file."
PRINT
PRINT" Delete";TAB(n)"Delete will remove the currently displayed character "
PRINT TAB(n)"record from the file. It will first give an alert box "
PRINT TAB(n)"to give you the option not to remove the character."
PRINT
PRINT" Print";TAB(n)"Selecting Print immediately prints out the displayed"
PRINT TAB(n)"characters information sheet."
RETURN
PageThree:
n=26 : GOSUB HeaderDis
PRINT" New File...";TAB(n)"Creates a new character file containing room "
PRINT TAB(n)"for 16 different characters. The file automatically"
PRINT TAB(n)"comes up as Record menu, then opens the first record"
PRINT TAB(n)"so that you can begin entering information "
PRINT TAB(n) "immediatelly."
PRINT
PRINT" Report...";TAB(n)"Allows the GM to choose between printing:"
PRINT
PRINT TAB(n+5)"(1) GM info sheets (short character reports)"
PRINT TAB(n+5)"(2) full character information sheets"
PRINT
PRINT" About GameMaster";TAB(n)"Gets program information."
PRINT
PRINT" Help";TAB(n)"Calls up this short help file.";
RETURN
HeaderDis:
CLS : TEXTFONT(0) : TEXTSIZE (12)
MOVETO 400,15 : PRINT "Page";btnID;"of 3"
IF btnID=1 THEN Head$="What GameMaster can do for you..."
IF btnID=2 THEN Head$="File options..."
IF btnID=3 THEN Head$="Create Options..."
MOVETO 15,15 : PRINT Head$
TEXTFONT(4) : TEXTSIZE (9)
PRINT " "
RETURN
CloseSub:
WINDOW CLOSE 3
ERASE Info$
END SUB
SUB TitleScreen STATIC
WINDOW 4,"",(70,60)-(440,220),-2
msg$(1)="GameMaster v1.0"
msg$(2)="Role Playing Character Record System"
msg$(3)="-----------------------------------"
msg$(4)="by L. Frank Turovich"
msg$(5)="Copyright 1987 by Ankh Enterprises"
msg$(6)="GEnie mail : BALTHASARD"
TEXTFONT(0) :TEXTSIZE(24)
y=40 : txt=FN centerTxt(msg$(1))
MOVETO txt,y : DrawText! msg$(1)
TEXTSIZE(12) : y=46
FOR j=2 TO 6
txt=FN centerTxt(msg$(j)) : y=y+18
MOVETO txt,y : DrawText! msg$(j)
NEXT
INITCURSOR
WHILE MOUSE(0)=0 : WEND
WINDOW CLOSE 4
END SUB
' ---------------------------------------
' SECTION G : Alert Messsages
' ---------------------------------------
OpenErr:
msg$(1)="GameMaster cannot open "+FileTitle$
msg$(2)=" while it is in an HFS folder."
Message msg$(),1,0,0
RETURN
SaveErr:
msg$(1)="Do you want to close "+FileTitle$
msg$(2)=" without saving "+FN Drop$(EDIT$(1))+"?"
Message msg$(),1,1,1
RETURN
MoveTheChar:
msg$(1)="Now moving "+FN Drop$(CharData$(1))+" to "
Temp$=FileTitle$ : StrpName (SecTitle$)
SecTitle$=FileTitle$ : FileTitle$=Temp$ : Temp$=""
msg$(2)=SecTitle$+" file."
Message msg$(),0,0,0
RETURN
FullCharFile:
msg$(1)="This file is full. Do you still want to "
msg$(2)="move "+FN Drop$(CharData$(1))+"?"
Message msg$(),1,1,0
IF btnID=1 THEN GOSUB EndMove : GOTO MoveChar
RETURN EndMove
MoveErr:
msg$(1)="You cannot move "+FN Drop$(CharData$(1))+" to "
msg$(2)="the same file. Try again with another."
Message msg$(),1,0,0
GOSUB EndMove
RETURN
DeleteWarning:
msg$(1)="Are you sure you want to delete "
msg$(2)=FN Drop$(CharData$(1))+"from "+FileTitle$+"?"
Message msg$(),1,1,0
RETURN
PrintWarning:
charFlag=true
msg$(1)="Make sure the printer is turned on "
msg$(2)="before continuing."
Message msg$(),1,1,0
RETURN
CreateFMsg:
msg$(1)="Now creating "+FileTitle$+" character file "
msg$(2)="Press "+CHR$(17)+" . to halt."
Message msg$(),0,0,0
RETURN
LenError:
EDIT FIELD eField
msg$(1)="Entry too large for record field! "
msg$(2)="Delete some letters and try again."
Message msg$(),1,0,0
tooLong=1
RETURN
ReportWarning:
msg$(1)="Please wait while report is printed. "
msg$(2)="Press "+CHR$(17)+" . to stop printing."
Message msg$(),0,0,0
RETURN
' ---------------------------------------
' SECTION H : Initialization
' ---------------------------------------
Initialization:
DEFINT a-z
ChangeCursor! 4
true=-1 : false=0
cancl=0
fileFlag=2
charFlag=false
numEF=58
lora=24
OK$="OK" : Extra$="Save"
'DEF FN StrpName$(Dum$)=RIGHT$(Dum$,LEN(Dum$)-INSTR(Dum$,":"))
DEF FN Drop$(Dum$)=LEFT$(Dum$,INSTR(Dum$," "))
DEF FN centerTxt(msg$)=(WINDOW(2)/2)-(WIDTH(msg$)/2)
DIM Title$(lora),fldLen(lora),lSide(lora),y(lora)
FOR x=1 TO lora
READ Title$(x),fldLen(x),lSide(x),y(x)
NEXT x
DIM file(16),file$(1)
file(0)=1
DIM msg$(2)
DIM CharData$(numEF),CharChange$(numEF)
MENU 4,0,1,""
MENU 5,0,1,""
MENU 1,0,1,"File"
MENU 1,1,1,"Open..."
MENU 1,2,0,"Close"
MENU 1,3,0,"Save"
MENU 1,4,0,"-"
MENU 1,5,0,"Move..."
MENU 1,6,0,"Delete"
MENU 1,7,0,"Print"
MENU 1,8,0,"-"
MENU 1,9,1,"Goto BASIC "
MENU 1,10,1,"Quit"
CmdKey! 1,1,"O"
CmdKey! 1,3,"S"
CmdKey! 1,5,"M"
CmdKey! 1,6,"D"
CmdKey! 1,7,"P"
CmdKey! 1,10,"Q"
MENU 3,0,1,"Create"
MENU 3,1,1,"File..."
MENU 3,2,1,"Report"
MENU 3,3,0,"-"
MENU 3,4,1,"About GameMaster... "
MENU 3,5,1,"Help"
CmdKey! 3,1,"F"
CmdKey! 3,2,"R"
CmdKey! 3,5,"H"
ReDoRec:
MENU 4,0,1,"Record"
MENU 4,1,1,"No Record Open "
RETURN
' ---------------------------------------
' SECTION I : Data
' ---------------------------------------
EFieldData:
' ____section 1 - char info
DATA "Name",35,45,30
DATA "Level",4,45,44
DATA "Class",20,130,44
DATA "Align",22,45,58
DATA "Race",15,45,72
DATA "Sex",7,185,72
DATA "Armor",22,45,94
DATA "Wpn",25,45,108
' ____section 2 - stats
DATA "Str",5,295,30
DATA "Dex",5,295,44
DATA "Con",5,295,58
DATA "Int",5,375,30
DATA "Wis",5,375,44
DATA "Chr",5,375,58
DATA "Com",5,450,30
DATA "AC",3,450,44
DATA "HP",3,450,58
DATA "Exp Pts",20,350,76
DATA "Gems",30,290,94
DATA "Gold",6,265,108
DATA "Silv",6,350,108
DATA "Plat",6,435,108
' ____section 3 - magic items section
DATA Magic items,27,100,130
' ____section 4 - misc items section
DATA Misc items,23,278,130